{% extends "base.html" %}

{% block title %}All languages{% endblock %}

{% block content_title %}<h1>All snippets by languages</h1><h5><a href = "/kgp/cab/">All snippets</a> | <a href = "/kgp/cab/languages/">All snippets by languages</a> | <a href = "/kgp/cab/users/">All snippets by users</a> | {% if user.is_authenticated %} <a href = "/kgp/cab/add/">Add a snippet</a> {% endif %}</h5>{% endblock %}

{% block content %}
<ul>
{% for language in object_list %}
<li><a href="/kgp/cab/languages/{{language.name}}">{{ language.name }}</a></li>
{% endfor %}
</ul>

<p class="pagination">{% if has_previous %}<a href="?page={{ previous }}">&lt; Previous {{ results_per_page }}</a>{% endif %}&nbsp;&nbsp;{% if has_next %}<a href="?page={{ next }}">Next {{ results_per_page }} &gt;</a>{% endif %}</p>

{% endblock %}

{% block sidebar %}
<p>This site is currently accepting snippets in {{ hits }} language{{ hits|pluralize }}. The most popular ones, in order, are:</p>

{% load popular %}
{% get_top_languages 5 as top_languages %}

<ol>
{% for language in top_languages %}
<li><a href="/kgp/cab/languages/{{ language.name}}">{{ language.name }}</a></li>
{% endfor %}
</ol>
{% endblock %}
